Component({
  options: {
    addGlobalClass: true,
  },

  properties: {
    // id: {
    //   type: String,
    //   value: '',
    //   observer(id) {
    //     this.genIndependentID(id);
    //     if (this.properties.thresholds?.length) {
    //       this.createIntersectionObserverHandle();
    //     }
    //   },
    // },
    data: {
      type: Object,
      observer(data) {
        if(data) {
          this.setData({
            hospital: data
          })
        }
      },
    },
    currency: {
      type: String,
      value: '¥',
    }
  },

  data: {
    independentID: '',
    hospital: {  },
  },

  lifetimes: {
    ready() {
      this.init();
    },
    detached() {
      // this.clear();
    },
  },

  pageLifeTimes: {},

  methods: {
    clickHandle() {
      // this.triggerEvent('click', { goods: this.data.goods });
      let data = this.hospital
      console.log(data)
      let url = '/pages/hospital-product-list/index"?data=' + encodeURIComponent(JSON.stringify(data));

      wx.navigateTo({
        url: url
      });
    },


    init() {
      console.log("init card", this.hospital)
    },

    clear() {
      this.clearIntersectionObserverHandle();
    },

  },
});
